package com.simple.jdbc.core.sqlSession;

import com.simple.jdbc.core.executor.SimpleExecutor;
import com.simple.jdbc.core.pojo.Configuration;

public class DefaultSqlSessionFactory implements SqlSessionFactory {

    private Configuration configuration;

    public DefaultSqlSessionFactory(Configuration configuration) {
        this.configuration = configuration;
    }

    @Override
    public SqlSession openSession() {

        //创建 执行器
        SimpleExecutor simpleExecutor = new SimpleExecutor();

        //生产SqlSession
        DefaultSqlSession defaultSqlSession = new DefaultSqlSession(configuration, simpleExecutor);


        return defaultSqlSession;
    }
}
